
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <link rel="stylesheet" href="animate.min.css">
    <script src="swiper.animate.min.js"></script> -->
    <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.css">
    <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css">
    <script src="https://unpkg.com/swiper/swiper-bundle.js"> </script>
    <script src="https://unpkg.com/swiper/swiper-bundle.min.js"> </script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
</head>
<body>
    <!-- header页首标签 -->
    <header class="header-area overlay">
        <!-- nav导航标签 -->
        <nav class="navbar navbar-expand-md navbar-dark" >
            <div class="container">
                <a href="#" class="navbar-brand" style="margin-left: 7px;">Swiper</a>
                
                <button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#main-nav">
                    <span class="menu-icon-bar"></span>
                    <span class="menu-icon-bar"></span>
                    <span class="menu-icon-bar"></span>
                </button>
                
                <div id="main-nav" class="collapse navbar-collapse">
                    <ul class="navbar-nav ml-auto">
                        <li><a href="#" class="nav-item nav-link active">主页</a></li>
                        <li><a href="https://swiper.com.cn/" target="_blank" class="nav-item nav-link">官网</a></li>
                        <li class="dropdown">
                            <a href="#" class="nav-item nav-link" data-toggle="dropdown">动画</a>
                            <div class="dropdown-menu">
                                <a href="#animation" class="dropdown-item">动画 1</a>
                                <a href="#animation" class="dropdown-item">动画 2</a>
                                <a href="#animation" class="dropdown-item">动画 3</a>
                            </div>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="nav-item nav-link" data-toggle="dropdown">轮播</a>
                            <div class="dropdown-menu">
                                <a href="#swiperFirst" class="dropdown-item ">轮播 1</a>
                                <a href="#second" class="dropdown-item">轮播 2</a>
                                <a href="#second" class="dropdown-item">轮播 3</a>
                            </div>
                        </li>
                        <li><a href="https://github.com/surmon-china/vue-awesome-swiper" class="nav-item nav-link">GitHub</a></li>
                    </ul>
                </div>
            </div>
        </nav>
        
        <div class="banner">
            <div class="container">
                <h1>Swiper</h1>
                <p>Swiper插件轮播图整理</p>
                <a href="#content" class="button button-primary">学习中</a>
            </div>
        </div>
    </header>
    <!-- 暂时用不到 -->
<!--     
    <main>
        <section id="content" class="content">
            <div class="container">
                <div class="row">
                    <div class="col-md-4">
                        <p> </p>
                    </div>
                    <div class="col-md-4">
                        <p> </p>
                    </div>
                    <div class="col-md-4">
                        <p> </p>
                    </div>
                </div>
            </div>
        </section>
    </main> -->


     <!-- Swiper轮播1 -->
     
     <div class="swiper-container swiperFirst"  id="swiperFirst">
         <div class="swiper-wrapper"  >
             <div class="swiper-slide first"  >
                <img src="iqoopro-signal.mp4" alt="" srcset="">
             </div>
             <div class="swiper-slide second">
                 页面2
             </div>
             <div class="swiper-slide third">
                 页面3
             </div>
         </div>
         <!-- 如果需要分页器 -->
         <div class="swiper-pagination"></div>
 
         <!-- 如果需要导航按钮 -->
         <div class="swiper-button-prev"></div>
         <div class="swiper-button-next"></div>
 
         <!-- 如果需要滚动条 -->
         <div class="swiper-scrollbar"></div>
     </div>


   <!-- Swiper2 -->
  <div class="swiper-container base" id="second">
    <div class="swiper-wrapper">
      <div class="swiper-slide first">页面 1</div>
      <div class="swiper-slide second">页面 2</div>
      <div class="swiper-slide third">页面 3</div>
      <div class="swiper-slide first">页面 4</div>
      <div class="swiper-slide second">页面 5</div>
      <div class="swiper-slide third">页面 6</div>
      <div class="swiper-slide first">页面 7</div>
      <div class="swiper-slide second">页面 8</div>
      <div class="swiper-slide third">页面 9</div>
     
    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
    <!-- Add Arrows -->
    <div class="swiper-button-next"></div>
    <div class="swiper-button-prev"></div>
  </div>
    

  <div class="swiper-container animation" id="animation">
    <div class="swiper-wrapper">
      <div class="swiper-slide first" >页面1</div>
      <div class="swiper-slide second">页面2</div>
      <div class="swiper-slide third ">页面3</div>
      <div class="swiper-slide first ">页面4</div>
     
    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
    <div class="swiper-button-next"></div>
    <div class="swiper-button-prev"></div>
  </div>

  <footer class="panel-footer" style="overflow: hidden;background-color:  #40869B;margin-top: 40px;" id="footer">
    <div class="container" style="width: 100%;">
  <div class="row footer-top" style="text-align: center;width: 100%;">
  </div>
  <hr style="border: 1px  solid #40869B; width: 100%;">
  <div class="row" style="text-align: center;">
   <div class="col-sm-3 col-md-3 col-lg-3 "  style="margin-bottom: 12px;">
   <a href="#" style=" color: #fff;">首部</a>
    </div>
    <div class="col-sm-3 col-md-3 col-lg-3">
   <a href="#footer" style=" color:  #fff;">联系</a></li>
    </div>
    <div class="col-sm-3 col-md-3 col-lg-3">
   <a href="#footer" style=" color:  #fff;">关于</a></li>
    </div>
    <div class="col-sm-3 col-md-3 col-lg-3">
   <a href="#footer" style=" color:  #fff;">致谢</a></li>
    </div>
  </div>
    </div>
  </footer>
    <style>
      .container {
    max-width: 100%;
    padding-right: 0px;
    padding-left: 0px;
}
        /* 字体 */
        @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700,800');
@import url('https://fonts.googleapis.com/css?family=Lobster');
html {
  font-size: 62.5%;
}
body {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
}
h1 {
  margin-bottom: 0.5em;
  font-size: 3.6rem;
}
p {
  margin-bottom: 0.5em;
  font-size: 1.6rem;
  line-height: 1.6;
}
.button {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 25px;
  border-radius: 4px;
}
.button-primary {
  position: relative;
  background-color: #4390EE;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  transition: color 0.3s ease-in;
  z-index: 1;
}
.button-primary:hover {
  color:#4390EE;
  text-decoration: none;
}
.button-primary::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background-color: #fff;
  border-radius: 4px;
  opacity: 0;
  transform: scaleX(0.8);
  transition: all 0.3s ease-in;
  z-index: -1;
}
.button-primary:hover::after {
  opacity: 1;
  -webkit-transform: scaleX(1);
  -ms-transform: scaleX(1);
  transform: scaleX(1);
}
.overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background-color: rgba(0, 0, 0, .3);
}
.header-area {
  position: relative;
  height: 100vh;
  background: #5bc0de;
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repear;
  background-size: cover;
}
.banner {
  display: flex;
  align-items: center;
  position: relative;
  height: 100%;
  color: #fff;
  text-align: center;
  z-index: 1;
}
.banner h1 {
  font-weight: 800;
}
.banner p {
  font-weight: 700;
}
.navbar {
 background-color: #40869B;
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  width: 100%;
  transition: background 0.6s ease-in;
  z-index: 99999;
}
.navbar .navbar-brand {
  font-family: 'Lobster', cursive;
  font-size: 2.5rem;
}
.navbar .navbar-toggler {
  position: relative;
  height: 50px;
  width: 50px;
  border: none;
  cursor: pointer;
  outline: none;
}
.navbar .navbar-toggler .menu-icon-bar {
  position: absolute;
  left: 15px;
  right: 15px;
  height: 2px;
  background-color: #fff;
  opacity: 0;
  transform: translateY(-1px);
  transition: all 0.3s ease-in;
}
.navbar .navbar-toggler .menu-icon-bar:first-child {
  opacity: 1;
  transform: translateY(-1px) rotate(45deg);
}
.navbar .navbar-toggler .menu-icon-bar:last-child {
  opacity: 1;
  transform: translateY(-1px) rotate(135deg);
}
.navbar .navbar-toggler.collapsed .menu-icon-bar {
  opacity: 1;
}
.navbar .navbar-toggler.collapsed .menu-icon-bar:first-child {
  transform: translateY(-7px) rotate(0);
}
.navbar .navbar-toggler.collapsed .menu-icon-bar:last-child {
  transform: translateY(5px) rotate(0);
}
.navbar-dark .navbar-nav .nav-link {
  position: relative;
  color: #fff;
  font-size: 1.6rem;
}
.navbar-dark .navbar-nav .nav-link:focus, .navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
}
.navbar .dropdown-menu {
  padding: 0;
  background-color: rgba(0, 0, 0, .9);
}
.navbar .dropdown-menu .dropdown-item {
  position: relative;
  padding: 10px 20px;
  color: #fff;
  font-size: 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  transition: color 0.2s ease-in;
}
.navbar .dropdown-menu .dropdown-item:last-child {
  border-bottom: none;
}
.navbar .dropdown-menu .dropdown-item:hover {
  background: transparent;
  color:#4390EE;
}
.navbar .dropdown-menu .dropdown-item::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  top: 0;
  width: 5px;
  background-color:#4390EE;
  opacity: 0;
  transition: opacity 0.2s ease-in;
}
.navbar .dropdown-menu .dropdown-item:hover::before {
  opacity: 1;
}
.navbar.fixed-top {
  position: fixed;
  -webkit-animation: navbar-animation 0.6s;
  animation: navbar-animation 0.6s;
  background-color: rgba(0, 0, 0, .9);
}
.navbar.fixed-top.navbar-dark .navbar-nav .nav-link.active {
  color: #4390EE;
}
.navbar.fixed-top.navbar-dark .navbar-nav .nav-link::after {
  background-color: #4390EE;
}
.content {
  padding: 120px 0;
}
@media screen and (max-width: 768px) {
  .navbar-brand {
    margin-left: 20px;
  }
  .navbar-nav {
    padding: 0 20px;
    background-color: rgba(0, 0, 0, .9);
  }
  .navbar.fixed-top .navbar-nav {
    background: transparent;
  }
}
@media screen and (min-width: 767px) {
  .banner {
    padding: 0 150px;
  }
  .banner h1 {
    font-size: 5rem;
  }
  .banner p {
    font-size: 2rem;
  }
  .navbar-dark .navbar-nav .nav-link {
    padding: 23px 15px;
  }
  .navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 30%;
    right: 30%;
    height: 1px;
    background-color: #fff;
    transform: scaleX(0);
    transition: transform 0.1s ease-in;
  }
  .navbar-dark .navbar-nav .nav-link:hover::after {
    transform: scaleX(1);
  }
  .dropdown-menu {
    min-width: 200px; 
    animation: dropdown-animation 0.3s;
    transform-origin: top;
  }
}

@keyframes navbar-animation {
  0% {
    opacity: 0;
    -webkit-transform: translateY(-100%);
    -ms-transform: translateY(-100%);
    transform: translateY(-100%);
  }
  100% {
    opacity: 1;
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes dropdown-animation {
  0% {
    transform: scaleY(0);
  }
  75% {
    transform: scaleY(1.1);
  }
  100% {
    transform: scaleY(1);
  }
}


</style>
<style>
/* Swiper轮播1 */
*{
            margin: 0;
            padding: 0;
        }
     
        /* 这行重中之重 */
                    
        .swiper-container {
            width: 100%;
            height: 400px;
            margin-top: 30px;
        }    

        .swiper-slide{
            text-align: center;
            line-height: 400px;
            font-size: 30px;
            color: #fff;
        }
        .swiper-container img {
            width: 100%;
            height: 100%;
        }
        
        .first{
            background-color: #4390EE;
        }
        .second{
            background-color:#CA4040;
        }
        .third{
            background-color: #FF8604;
        }
    </style>

    <style>
      .animation {
        width: 94%;
      height: 400px;
    }
    .swiper-pagination-bullet {
      width: 20px;
      height: 20px;
      text-align: center;
      line-height: 20px;
      font-size: 12px;
      color:#000;
      opacity: 1;
      background: rgba(0,0,0,0.2);
    }
    .swiper-pagination-bullet-active {
      color:#fff;
      background: #007aff;
    }
    .swiperFirst .swiper-pagination-bullet{
      width: 10px;
      height: 10px;
    }
    </style>
    <script>
        // 可以用箭头函数但没必要
        $(function($) {
    $(window).on('scroll', function() {
        // 检测滚动距离
		if ($(this).scrollTop() >= 200) {
            // 添加类
			$('.navbar').addClass('fixed-top');
		} else if ($(this).scrollTop() == 0) {
            // 移除类
			$('.navbar').removeClass('fixed-top');
		}
	});
    
    // 根据鼠标进入进出出现下拉列表
	function adjustNav() {
		var winWidth = $(window).width(),
			dropdown = $('.dropdown'),
			dropdownMenu = $('.dropdown-menu');
		
		if (winWidth >= 768) {
			dropdown.on('mouseenter', function() {
				$(this).addClass('show')
					.children(dropdownMenu).addClass('show');
			});
			
			dropdown.on('mouseleave', function() {
				$(this).removeClass('show')
					.children(dropdownMenu).removeClass('show');
			});
		} else {
			dropdown.off('mouseenter mouseleave');
		}
	}
	
	$(window).on('resize', adjustNav);
	
	adjustNav();
});
</script>

<script>
// 轮播1
var mySwiper = new Swiper('.swiperFirst', {
            // direction: 'vertical', 
            // 垂直切换选项
           // 循环模式选项
          
            loop:true,
            // 如果需要分页器
            pagination: {
                el: '.swiper-pagination',
            },
            autoplay: {
          delay: 2000,
          disableOnInteraction: false
           },
            // 如果需要前进后退按钮
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },

            // 如果需要滚动条
            // scrollbar: {
            //     el: '.swiper-scrollbar',
            // },
        })    
    </script>

<!-- 轮播2 -->
<script>
  var swiper2 = new Swiper('.base', {
    slidesPerView: 3,
    spaceBetween: 30,
    slidesPerGroup: 3,
    loop: true,
    loopFillGroupWithBlank: true,
    pagination: {
      el: '.swiper-pagination',
      clickable: true,
      type: 'fraction'
    },
    autoplay: {
          delay: 2000,
          disableOnInteraction: false
           },
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
    },
  });
</script>


<script>
  var swiper1 = new Swiper('.animation', {
    effect: 'cube',
    grabCursor: true,
    cubeEffect: {
      shadow: true,
      slideShadows: true,
      shadowOffset: 20,
      shadowScale: 0.94,
    },
    loop: true,
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
    },
    autoplay: {
        delay: 2000,
        disableOnInteraction: false
         },
    pagination: {
      el: '.swiper-pagination',
      clickable: true,
      renderBullet: function (index, className) {
          return '<span class="' + className + '">' + (index + 1) + '</span>';
    }}
  });
</script>
</body>
</html>